import { Module } from '@nestjs/common'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { TypeOrmModule } from '@nestjs/typeorm'
import { Connection } from 'typeorm'
import { User } from './users/users.entity'
import { Loser } from './losers/losers.entity'
// import { UsersModule } from './users/users.module'
import { AuthModule } from './auth/auth.module'
import { MulterModule } from '@nestjs/platform-express'
import { LosersController } from './losers/losers.controller'
import { LosersModule } from './losers/losers.module'

@Module({
  imports: [
    MulterModule.register({
      dest: './upload',
    }),
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: '127.0.0.1',
      port: 3306,
      username: 'root',
      password: '123456',
      database: 'tuanyuanyuan',
      entities: [User, Loser],
      synchronize: true,
    }),
    // UsersModule, 
    AuthModule,
    LosersModule,
  ],
  controllers: [AppController, LosersController],
  providers: [AppService],
})
export class AppModule {
  constructor(private readonly connection: Connection) {}
}
